package com.biwin.module.org.domain.entity;

import com.biwin.module.orm.api.entity.BwBasicEntity;

import javax.persistence.*;

/**
 * Position 岗位
 *
 * @author biwin
 * @since 0.0.1
 */
@Entity
@Table(name = "position",
        indexes = {@Index(name = "unique_name", columnList = "name", unique = true)}
)
@org.hibernate.annotations.Table(appliesTo = "position", comment = "岗位表")
public class Position extends BwBasicEntity {

    private static final long serialVersionUID = -4471882278200314643L;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "parent_id", columnDefinition = " BIGINT(20) COMMENT '父级编号' ",
            foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
    private Position parent;

    @Column(name = "name", columnDefinition = "VARCHAR(60) NOT NULL COMMENT '岗位名称' ")
    private String name;

    @Column(name = "type", columnDefinition = "TINYINT(1) NOT  NULL  COMMENT '岗位类型()' ")
    private Integer type;

    @Column(name = "administrator", columnDefinition = "BIT(1) NOT NULL DEFAULT B'0' COMMENT '是管理员岗位' ")
    private Boolean administrator = false;

    @Column(name = "shared", columnDefinition = "BIT(1) NOT NULL DEFAULT B'0' COMMENT '是共享岗位' ")
    private Boolean shared = false;

    @Column(name = "copied", columnDefinition = "BIT(1) NOT NULL DEFAULT B'0' COMMENT '是复制岗位' ")
    private Boolean copied = false;

    @Column(name = "enabled", columnDefinition = "BIT(1) NOT NULL DEFAULT B'0' COMMENT '启用岗位' ")
    private Boolean enabled = false;

    public Position getParent() {
        return parent;
    }

    public void setParent(Position parent) {
        this.parent = parent;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public Boolean getAdministrator() {
        return administrator;
    }

    public void setAdministrator(Boolean administrator) {
        this.administrator = administrator;
    }

    public Boolean getShared() {
        return shared;
    }

    public void setShared(Boolean shared) {
        this.shared = shared;
    }

    public Boolean getCopied() {
        return copied;
    }

    public void setCopied(Boolean copied) {
        this.copied = copied;
    }

    public Boolean getEnabled() {
        return enabled;
    }

    public void setEnabled(Boolean enabled) {
        this.enabled = enabled;
    }

}
